import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/apis/layout'


export const useCategoryStore = defineStore('categoryStore', () => {
  // 导航数据，避免LayoutHeader和LayoutFixed重复请求
  const categoryList = ref([])
  const getCategory = async () => {
    const res = await getCategoryAPI()
    categoryList.value = res.result
    // console.log(res)
  }

  return { categoryList, getCategory }
})
